package com.xiaomaoguai.cloud.controller;

import io.swagger.annotations.Api;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * @ ClassName: BookController.java
 * @ Author: WeiHui-Z
 * @ Date: 2016/12/6 12:34
 * @ Version: v1.0.0
 */
@RestController
@Api(value = "/", description = "有关书籍的操作")
public class BookController {

	private static final Logger LOGGER = LoggerFactory.getLogger(BookController.class);

	@Autowired
	private DiscoveryClient discoveryClient;

	/**
	 * 本地服务实例的信息
	 */
	@GetMapping("/instance-info")
	@ApiIgnore
	public ServiceInstance showInfo() {
		return discoveryClient.getLocalServiceInstance();
	}

}